<template>
    <div v-transfer-dom>
        <popup v-model="showValue" style="width:80%;height:80%;left:10%;top:10%;border-radius:8px;" position="bottom">
            <login :isWin="true" v-on:toVisible="loginWinVis"></login> <!---->
        </popup>
    </div>
</template>
<script>
import {
    Popup,TransferDomDirective as TransferDom
} from 'vux'
import {
    mapState,
    mapActions
} from 'vuex'

import api from '../api'
import Login from "./Login";

export default {
    directives: {TransferDom},
    components: {
        Login,Popup
    }, 
    props:{        
        show: Boolean,
    },
    computed:{        
        ...mapState({
            isLogin: state => state.vux.isLogin,
            uid: state => state.vux.uid
        })
    },
    watch: {
        "show":function(val){
            // console.warn("show",val);
            if(!val) return ;
            this.showValue = val;
        },
        showValue(val){
            if(!val) this.$emit('toVisible',this.login) ;
        }
    },
    created() {
    },
    mounted: function() { 
    },
    methods: {
        loginWinVis(val){
            this.login = val ;
            this.showValue = false ;
        },
    },
    data() {
        return {
            login:false,
            showValue:false,
        }
    }
}
</script>
